package org.atlantis.uzw.base.job;

import java.util.Date;
import java.util.concurrent.TimeUnit;

public class JobTest {

	public static void main(String[] args) throws Exception {
		HashedWheelJobManager jobMgr = new HashedWheelJobManager();
		jobMgr.setTickDuration(5);
		jobMgr.setTicksPerWheel(512);
		jobMgr.afterPropertiesSet();

		JobHandler jobHandler = new JobHandler() {
			@Override
			public void run(Job job) throws Exception {
				System.out.println(new Date().toString());
				job.jobManager().newJob(this, 1, TimeUnit.SECONDS);
			}
		};
		System.out.println(new Date().toString());
		jobMgr.newJob(jobHandler, 5, TimeUnit.SECONDS);
	}
}
